﻿using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using Sharp.DataTransferObject;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;
using Sharp.Infrastructure.Search;

namespace Sharp.ServiceContracts
{
    [ServiceContract]
    public interface IEnterpriseService : IApplicationServiceContract
    {
        #region 人员模块
        /// <summary>
        /// 保存员工
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveEmployee(EmployeeDTO model);
        /// <summary>
        /// 删除员工
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteEmployee(Guid[] ids);

        /// <summary>
        /// 获取员工
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        EmployeeDTO GetEmployeeInfo(Guid id);

        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<EmployeeDTO> GetEmployeePaged(PagingFeature pf);


        /// <summary>
        /// 组织里面的员工
        /// </summary>
        /// <param name="orgIds"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        IEnumerable<EmployeeDTO> GetEmployeesInOrg(Guid[] orgIds);

        /// <summary>
        /// 保存工作岗位
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveJob(JobDTO model);
        /// <summary>
        /// 删除工作岗位
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteJob(Guid[] ids);

        /// <summary>
        /// 获取员工
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        JobDTO GetJobInfo(Guid id);

        /// <summary>
        /// 获取分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<JobDTO> GetJobPaged(PagingFeature pf);
        #endregion

        #region 组织结构模块
        /// <summary>
        /// 保存组织结构
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveOrg(OrgDTO model);
        /// <summary>
        /// 删除组织结构
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteOrgs(Guid[] ids);
        /// <summary>
        /// 获取组织结构
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        OrgDTO GetOrgInfo(Guid id);
        /// <summary>
        /// 获取所有组织结构
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        IEnumerable<OrgDTO> GetOrgs();
        /// <summary>
        /// 组织结构排序
        /// </summary>
        /// <param name="parentId"></param>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result OrgMoveOrSort(Guid? parentId, Guid[] ids);
        /// <summary>
        /// 获取组织结构层次
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        IEnumerable<OrgLevelDTO> GetOrgLevelList();


        /// <summary>
        /// 保存组
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result SaveGroup(GroupDTO model);
        /// <summary>
        /// 删除组
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        Result DeleteGroups(Guid[] ids);
        /// <summary>
        /// 获取组
        /// </summary>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        GroupDTO GetGroupInfo(Guid id);
        /// <summary>
        /// 获取组分页数据
        /// </summary>
        /// <param name="pf"></param>
        /// <returns></returns>
        [OperationContract, FaultContract(typeof(FaultData))]
        PagedResult<GroupDTO> GetGroupPaged(PagingFeature pf);

        #endregion

        
    }
}
